<!-- 主页设计：
 1.引入公共头部header.php
 2.加轮播
 3.推荐商品部分：关键点isnice=1
 4.最新上架商品：关键点order by id desc
 5.引入公布部分footer.php
 -->
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
    <title>网站主页面</title>
</head>
<body>
<?php include_once("header.php");?>
<!-- swiper轮播图 -->
<!-- 1.加载插件的swiper.css和swiper.js -->
<script src="./Public/js/swiper-3.3.1.jquery.min.js"></script>
<!-- 轮播图部分 -->
<div class="banner_ctr">
	<!-- 2.html内容 -->
	<div class="swiper-container">
		<!-- 轮播左箭头 -->
		<div class="b_left"></div>
		<div class="swiper-wrapper">
			<div class="swiper-slide">
				<img src="./Public/images/banner1.jpg"/>
			</div>
			<div class="swiper-slide">
				<img src="./Public/images/banner2.jpg"/>
			</div>
		</div>
		<!-- 轮播右箭头 -->
		<div class="b_right"></div>
		<!-- 切换圆点(分页器) -->
		<div class="swiper-pagination"></div>
	</div>
	<!-- 3.初始化swiper -->
	<script>
	var swiper = new Swiper('.swiper-container', {
		pagination: '.swiper-pagination',
		paginationClickable: '.swiper-pagination',
		nextButton: '.b_left',
		prevButton: '.b_right',
		autoplay: 2000,//可选选项，自动滑动
		spaceBetween: 30,
		loop: true
	});
	</script>
</div>
<!-- 推荐商品部分 -->
<div class="m_ctr">
    <div class="m_t1">
		<!-- 横线 -->
		<div class="m_tline"></div>
		<div class="m_t11">推荐商品</div>
	</div>
	<div class="m_ctr1">
		<?php 
		$i=1; 
		$new_art1 = db_get_all("select * from goods where isno=0 and isnice=1 and status='已审核' order by id desc limit 4"); 
		foreach($new_art1 as $row) {
			?>
			<div class="m_pctr1" onMouseOver="document.getElementById('c<?php echo $i;?>').className='m_pic11'" onMouseOut="document.getElementById('c<?php echo $i;?>').className='m_pic1'" <?php if($i==4){?>} style="margin-right:0;"<?php }?>>
				<div class="m_pic1" id="c<?php echo $i;?>">
					<a href="goodsshow.php?id=<?php echo $row['id'];?>&categoryid=<?php echo $row['categoryid'];?>">
						<img src="./Public/Upload/<?php echo $row["img"];?>">
					</a>
				</div>
				<div class="m_pt11">
					<a href="goodsshow.php?id=<?php echo $row['id'];?>&categoryid=<?php echo $row['categoryid'];?>"><?php echo $row['title'];?></a>
				</div>
				<div class="m_pt12">
					￥<?php echo $row['sprice'];?>&emsp;<span>￥<?php echo $row['mprice'];?></span>
				</div>
			</div>
		<?php $i = $i+1; }?>
    </div>
</div>
<!-- 最新商品部分 -->
<div class="m_ctr">
    <div class="m_t1">
		<div class="m_tline"></div>
		<div class="m_t11">最新商品</div>
	</div>
    <div class="m_ctr1">
		<?php 
		$i=1;  
		$new_art1 = db_get_all("select * from goods where isno=0 and status='已审核'  order by id desc limit 10"); 
		foreach($new_art1 as $row) {?>
        <div class="m_pctr2" onMouseOver="document.getElementById('x<?php echo $i;?>').className='m_pic12'" onMouseOut="document.getElementById('x<?php echo $i;?>').className='m_pic2'"  <?php if($i==5||$i==10){?>} style="margin-right:0;"<?php }?>>
            <div class="m_pic2" id="x<?php echo $i;?>">
				<a href="goodsshow.php?id=<?php echo $row['id'];?>&categoryid=<?php echo $row['categoryid'];?>">
					<img src="./Public/Upload/<?php echo $row["img"];?>">
				</a>
			</div>
            <div class="m_pt11">
				<a href="goodsshow.php?id=<?php echo $row['id'];?>&categoryid=<?php echo $row['categoryid'];?>"><?php echo $row['title'];?></a>
			</div>
            <div class="m_pt12">
				￥<?php echo $row['sprice'];?>&emsp;<span>￥<?php echo $row['mprice'];?></span>
			</div>
		</div>
		<?php $i = $i+1;}?>
    </div>
</div>
<!-- 引入底部 -->
<?php include("footer.php");?>
</body>
</html>